package com.right.health.app.dialog;

import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;

import com.right.health.app.R;

/*
 * Created by hopeliao on 2019-09-27
 *
 */
public class PhotoDialog extends BaseBottomSheetDialog implements View.OnClickListener {

    private View[] mChildViews;

    public void setClickListener(View.OnClickListener listener) {
        if (mChildViews != null) {
            for (View view : mChildViews) {
                view.setOnClickListener(listener);
            }
        }
    }

    public PhotoDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected int getContentViewId() {
        return R.layout.dialog_photo;
    }

    @Override
    protected void findViews() {
        super.findViews();
        mChildViews = new View[2];

        findViewById(R.id.tv_cancel).setOnClickListener(this);
        findViewById(R.id.view_placeholder).setOnClickListener(this);

        mChildViews[0] = findViewById(R.id.tv_choose_camera);
        mChildViews[1] = findViewById(R.id.tv_choose_album);
    }

    @Override
    public void onClick(View v) {
        dismiss();
    }
}
